#include <glut.h>

void renderScene()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();

	glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
	// Sphere
	glTranslatef(-0.5, 0.5, 0);
	GLUquadricObj* obj = gluNewQuadric();
	gluSphere(obj, 0.1, 20, 20);

	glLoadIdentity();
	glBegin(GL_TRIANGLE_FAN);
		glColor3f(1, 1, 0);
		glVertex3f(-0.5,-0.5,0.0);
		glColor3f(0, 1, 1);
		glVertex3f(0.5,0.0,0.0);
		glColor3f(1, 0, 1);
		glVertex3f(0.0,0.5,0.0);
		glColor3f(0, 1, 0);
		glVertex3f(-.5, 0.5,0.0);
	glEnd();

	glutSwapBuffers();
}

int main(int argc, char **argv)
{
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
	glutInitWindowPosition(100, 100);
	glutInitWindowSize(640, 640);
	glutCreateWindow("Lighthouse3D- GLUT Tutorial");

	glutDisplayFunc(renderScene);

	glutMainLoop();

	return 1;
}